import { axios } from '@/utils/request'

/**
 * 查询二手车车源
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldPage (parameter) {
  return axios({
    url: '/carSourceOld/page',
    method: 'get',
    params: parameter
  })
}

/**
 * 二手车车源列表
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldList (parameter) {
  return axios({
    url: '/carSourceOld/list',
    method: 'get',
    params: parameter
  })
}

/**
 * 二手车获取详情
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldDetail (parameter) {
  return axios({
    url: '/carSourceOld/detail',
    method: 'post',
    data: parameter
  })
}

/**
 * 添加二手车车源
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldAdd (parameter) {
  return axios({
    url: '/carSourceOld/add',
    method: 'post',
    data: parameter
  })
}

/**
 * 编辑二手车车源上传图片
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldEdit (parameter) {
  return axios({
    url: '/carSourceOld/edit',
    method: 'post',
    data: parameter
  })
}

/**
 * 删除二手车车源
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldDelete (parameter) {
  return axios({
    url: '/carSourceOld/delete',
    method: 'post',
    data: parameter
  })
}

/**
 * 导出二手车车源
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function carSourceOldExport (parameter) {
  return axios({
    url: '/carSourceOld/export',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
/**
 * 导出二手车车源上传图片
 *
 * @author gyp
 * @date 2023-08-03 22:48:06
 */
export function uploadFile (formData) {
  console.log(formData.get('file'))
  return axios({
    url: '/car/uploadFile',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data: formData
  })
}
